﻿​

void bubble_sort(int arr[], int n)
{
	int i = 0; int j = 0; int tmp = 0;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n - 1; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				tmp = arr[j + 1];
				arr[j + 1] = arr[j];
				arr[j] = tmp;
			}
		}
	}
}

​void swap(int* p1, int* p2)
{
	int tmp = 0;
	tmp = *p2;
	*p2 = *p1;
	*p1 = tmp;
}
void R_sto(int arr[], int sz)
{
	int* p1 = arr;
	int* p2 = &arr[sz - 1];
	int n = sz / 2;
	while (n)
	{
		int tmp = *p2;
		*p2 = *p1;
		*p1 = tmp;
		n--;
	}
}
void AS_arr(int* p, int n)
{
	for (int i = 0; i < n; i++)
	{
		scanf("%d", (p + i));
	}
}
void P_arr(int arr[], int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d", arr[i]);
	}
}
void AS2_arr(int(*p)[N], int n, int m)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			scanf("%d", (*(p + i) + j));
		}
	}
}
void P2_arr(int(*p)[N], int n, int m)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			printf("%d", *(*(p + i) + j));
		}
	}
}
int ADD(int m, int n)
{
	return m + n;
}
int SUB(int m, int n)
{
	return m - n;
}
int MUL(int m, int n)
{
	return m * n;
}
int DIV(int m, int n)
{
	if (n != 0)
	{
		return m + n;
	}
	else
	{
		printf("除数不能为零！");
	}
}